package cn.iocoder.yudao.module.crossborder.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 跨境电商订单来源枚举
 *
 * @author LHL
 */
@AllArgsConstructor
@Getter
public enum OrderSourceEnum {

    WEB(1, "网站"),
    MOBILE_APP(2, "手机APP"),
    WECHAT(3, "微信"),
    API(4, "API接口"),
    ADMIN(5, "后台管理"),
    IMPORT(6, "批量导入"),
    ;

    /**
     * 来源值
     */
    private final Integer source;
    
    /**
     * 来源名称
     */
    private final String name;

    public static OrderSourceEnum getBySource(Integer source) {
        for (OrderSourceEnum value : values()) {
            if (value.getSource().equals(source)) {
                return value;
            }
        }
        return null;
    }

}
